package com.kexio.enterprise.integration.event.status;

import com.kexio.enterprise.integration.event.enums.EventStatus;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
 * 事件处理状态
 * 
 * @author Kexio
 * @since 1.0.0
 */
public class EventProcessingStatus {
    private String eventId;
    private EventStatus status;
    private int totalHandlers;
    private int completedHandlers;
    private int failedHandlers;
    private List<HandlerStatus> handlerStatuses;
    private LocalDateTime startTime;
    private LocalDateTime endTime;
    private long totalProcessingTime;
    private String currentHandler;
    private int retryCount;
    private Map<String, Object> processingMetadata;

    public EventProcessingStatus() {
        this.startTime = LocalDateTime.now();
        this.retryCount = 0;
    }

    // Getters and Setters
    public String getEventId() { return eventId; }
    public void setEventId(String eventId) { this.eventId = eventId; }
    
    public EventStatus getStatus() { return status; }
    public void setStatus(EventStatus status) { this.status = status; }
    
    public int getTotalHandlers() { return totalHandlers; }
    public void setTotalHandlers(int totalHandlers) { this.totalHandlers = totalHandlers; }
    
    public int getCompletedHandlers() { return completedHandlers; }
    public void setCompletedHandlers(int completedHandlers) { this.completedHandlers = completedHandlers; }
    
    public int getFailedHandlers() { return failedHandlers; }
    public void setFailedHandlers(int failedHandlers) { this.failedHandlers = failedHandlers; }
    
    public List<HandlerStatus> getHandlerStatuses() { return handlerStatuses; }
    public void setHandlerStatuses(List<HandlerStatus> handlerStatuses) { this.handlerStatuses = handlerStatuses; }
    
    public LocalDateTime getStartTime() { return startTime; }
    public void setStartTime(LocalDateTime startTime) { this.startTime = startTime; }
    
    public LocalDateTime getEndTime() { return endTime; }
    public void setEndTime(LocalDateTime endTime) { this.endTime = endTime; }
    
    public long getTotalProcessingTime() { return totalProcessingTime; }
    public void setTotalProcessingTime(long totalProcessingTime) { this.totalProcessingTime = totalProcessingTime; }
    
    public String getCurrentHandler() { return currentHandler; }
    public void setCurrentHandler(String currentHandler) { this.currentHandler = currentHandler; }
    
    public int getRetryCount() { return retryCount; }
    public void setRetryCount(int retryCount) { this.retryCount = retryCount; }
    
    public Map<String, Object> getProcessingMetadata() { return processingMetadata; }
    public void setProcessingMetadata(Map<String, Object> processingMetadata) { this.processingMetadata = processingMetadata; }
}
